package jym.tan.tmdb.method.auth;

import java.net.URL;

import jym.tan.tmdb.TMDB;
import jym.tan.tmdb.bean.SessionID;
import jym.tan.tmdb.constant.TMDBConstants;
import jym.tan.tmdb.method.Base;

public class AuthenticationSessionID extends Base {

	public AuthenticationSessionID(TMDB tmdb) {
		super(tmdb, TMDBConstants.AUTHENTICATION, TMDBConstants.NEW_SESSION);
	}

	public SessionID getSessionID(String requestToken) throws Exception {
		URL sessionIDUrl = getAuthUrl(requestToken);		
		SessionID sessionID = getJsonObject(sessionIDUrl, SessionID.class);
		return sessionID;
	}
}
